home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-07-28 | 10.0 KB | 296 lines | [TEXT/MPS ] |
- /*
- File: SimpleALNKAddressTemplate.r
-
- Copyright: © 1991-1994 by Apple Computer, Inc.
- All rights reserved.
-
- Part of the AOCE Sample SMSAM Package. Consult the license
- which came with this software for your specific legal rights.
-
- */
-
-
-
- #ifndef __TYPES__
- #include "Types.r"
- #endif
-
- #ifndef __OCE.R__
- #include "OCE.r"
- #endif
-
- #ifndef __OCE__
- #include "OCE.h"
- #endif
-
- #ifndef __OCETEMPLATES__
- #include "OCETemplates.h"
- #endif
-
- // properties
-
- #define kXtnType kDETFirstDevProperty
- #define kTypeChk (kDETFirstDevProperty+1)
- #define kPrDNodeNumber (kDETFirstDevProperty+2)
- #define kPrDirName (kDETFirstDevProperty+3)
- #define kPrDirDiscA (kDETFirstDevProperty+4)
- #define kPrDirDiscB (kDETFirstDevProperty+5)
- #define kPrPart1 (kDETFirstDevProperty+6)
- #define kPrPart2 (kDETFirstDevProperty+7)
- #define kPrPart3 (kDETFirstDevProperty+8)
- #define kPrNumOfPathParts (kDETFirstDevProperty+9)
- #define kPrCidSource (kDETFirstDevProperty+10) /* long 00000000*/
- #define kPrCidSequence (kDETFirstDevProperty+11) /* long 00000000*/
- #define kPrEntityName (kDETFirstDevProperty+12)
- #define kPrEnitityType (kDETFirstDevProperty+13) /* RSrting " User" */
- #define kPrALNKAddress (kDETFirstDevProperty+14) // ALNK Address
- #define kPrTheValue2 (kDETFirstDevProperty+15)
-
- // ************************************** The templates: ******************************
- // Resource ids (note: these ids are packed together more tightly than is normal for templates; this is
- // done in order to fit within the id range allocated to clFindInfoPage):
-
- #define kDETAddrFirstID (5000)
- #define kDETAddrSecondID (5000+kDETIDSep)
- #define kDETAddrThirdID (5000+2*kDETIDSep)
-
- #define kALNKAddressInfoPageAspect kDETAddrFirstID // pref mail slot aspect
- #define kALNKAddressInfoPage kDETAddrSecondID // info page header view
-
- #define kALNKAddressRecTypeBody kUserRecTypeBody
-
- // ************************************** Main Aspect: ******************************
- // this is an aspect template
- // main aspect tells the DE what kind and what category this template is in the sublist
-
- // the kind is address
- resource 'rstr' (kALNKAddressInfoPageAspect+kDETAspectKind, purgeable) {
- "Address"
- };
-
- //resource 'rstr' (kALNKAddressInfoPageAspect+kDETAspectName, purgeable) {
- // "Applelink Address"
- //};
-
-
- // this will make "New Applelink Address" shows in directory menu ??? is this in main aspect???
- resource 'rstr' (kALNKAddressInfoPageAspect+kDETAspectNewMenuName, purgeable) {
- "New Applelink Address"
- };
-
-
- /* ************************************** InfoPage Aspect ******************************************** */
- // Aspect for ALNK pref mail slot:
- // 'deta' this is a aspect template
- resource 'deta' (kALNKAddressInfoPageAspect, purgeable) { 0, dropCheckConflicts, isMainAspect };
-
- resource 'rstr' (kALNKAddressInfoPageAspect+kDETTemplateName, purgeable) {
- "Applelink Address Info Page Aspect"
- };
-
- // this template apply to the ÓUser record
- resource 'rstr' (kALNKAddressInfoPageAspect+kDETRecordType, purgeable) {
- kALNKAddressRecTypeBody
- };
-
- // this template apply to the kPrefMailAttrTypeBody attribute
- resource 'rstr' (kALNKAddressInfoPageAspect+kDETAttributeType, purgeable) {
- kMailSlotsAttrTypeBody
- };
-
- resource 'detw' (kALNKAddressInfoPageAspect+kDETAspectInfoPageCustomWindow, "Applelink address Custom Window", purgeable) {
- {-1, -1, kDETAttributeInfoWindHeight, kDETAttributeInfoWindWidth},
- includePopup
- };
-
- resource 'detn' (kALNKAddressInfoPageAspect+kTypeChk) { 'ALNK' };
- resource 'detn' (kALNKAddressInfoPageAspect+kDETAttributeValueTag) { 'ALNK' };
-
- // dett attribute look up table
- // if you want to change this table, do change kDETAspectNewValue to match the new table
- resource 'dett' (kALNKAddressInfoPageAspect+kDETAspectLookup, "Applelink Address lookup guide", purgeable)
- {{
- {kMailSlotsAttrTypeBody},
- 'ALNK',
- useForInput,
- useForOutput,
- notInSublist,
- isNotAlias,isNotRecordRef,
- // mailslot attribute
- {
-
- // unused fields here
-
- /* generic stuff (no changes needed) */
-
- 'wsiz', kDETNoProperty, 0;
- '((((', kDETNoProperty, 0; // kWholeLength
- 'long', kXtnType, 0; /* long 'ALNK'*/
- 'equa', kXtnType, kTypeChk;
- 'enab', kDETNoProperty, 0;
- 'wsiz', kDETNoProperty, 0;
- '((((', kDETNoProperty, 0; // kPackedRidLength
- 'wsiz', kDETNoProperty, 0;
- '((((', kDETNoProperty, 0; // kRLILength 0032
- 'long', kPrDNodeNumber, 0;
- 'rstr', kPrDirName, 0;
- 'awrd', kDETNoProperty, 0;
-
- 'long', kPrDirDiscA, 0;
- 'long', kPrDirDiscB, 0;
-
- 'wsiz', kDETNoProperty, 0;
- '((((', kDETNoProperty, 0; // kPackedPathLength
- 'word', kPrNumOfPathParts, 0;
- '))))', kDETNoProperty, 0; // kPackedPathLength
- '))))', kDETNoProperty, 0; // kRLILength
-
- 'long', kPrCidSource, 0; /* long 00000000*/
- 'long', kPrCidSequence, 0; /* long 00000000*/
-
- 'rstr', kDETAspectName, 0; /* RString "<Name>" */
- 'awrd', kDETNoProperty, 0;
- 'rstr', kPrEnitityType, 0; /* RString " User" */
- 'awrd', kDETNoProperty, 0;
- '))))', kDETNoProperty, 0; // kPackedRidLength
-
- /* specific address information */
-
- 'rstr', kPrALNKAddress, 0; /* "<address@host>" */
- 'awrd', kDETNoProperty, 0;
-
- '))))', kDETNoProperty, 0; // kWholeLength
- 'Pref', kDETNoProperty, 0; // let address page know to update pref mail slot
- };
- }};
-
-
- // this data is in the format desribed in the above 'dett'
- // (few changes needed, marked with %%% where need to change)
-
- #if 1
- data 'detb' (kALNKAddressInfoPageAspect+kDETAspectNewValue, "Default ALNK RLI") {
- // $"6473 7063" // %%% 'dspc' tag
- $"414C 4E4B" // ****** THIS CHANGES TO 'ALNK' FOR A12
-
- $"0042" // %%% length of all data following
- $"414C 4E4B" // %%% 4 character addr type ('ALNK')
-
- $"0038" // %%% length of packed RID
-
- $"0020" // %%% length of RLI
- $"0000 0000" // DNode # (0)
- $"0000 0009 4170 706C 656C 696E 6B00" // %%% Directory name ("Applelink"), even padded
-
- $"414C 4E4B" // discriminator A ('ALNK')
- $"0000 0000" // discriminator B (0)
-
- $"0004 0000" // packed pathname size
-
- $"0000 0000" // CID source
- $"0000 0000" // CID sequence
-
- $"0000 0000" // %%% name RString ("<Name>")
- $"0000 0005 F055 7365 7200" // type RString (".User")
-
- $"0000 0000" // %%% xtn value RString ("<Applelink address>")
- };
- #endif
-
- // ************************************** The info-page: ******************************
-
-
- // item location in inforpage template window
-
- #define kNameTop kDETSubpageLabelTop
- #define kNameBottom (kNameTop + kDETAppFontLineHeight+4)
- #define kAddressTop (kNameBottom+8)
- #define kAddressBottom (kAddressTop + kDETAppFontLineHeight+4)
-
- #define kMy1stColumnLeft (kDET1stColumnLeft-40)
- #define kMy1stColumnRight (kDET1stColumnRight-40)
- #define kMy2ndColumnLeft (kDET2ndColumnLeft-40)
- #define kMy2ndColumnRight (kDETAttribute2ndColumnRight)
-
- // info page (view) template ('deti')
- resource 'deti' (kALNKAddressInfoPage, purgeable) {
- 1000,
- kDETSublistRect,
- selectFirstText,
- {
- kDETNoProperty, kDETNoProperty, kALNKAddressInfoPage;
- },
- {}
- };
-
-
- // this template apply to the ÓUser record
- resource 'rstr' (kALNKAddressInfoPage+kDETRecordType, purgeable) {
- kALNKAddressRecTypeBody
- };
-
- // this is the name of the InfoPage template, don't use same name as your aspect name
- resource 'rstr' (kALNKAddressInfoPage+kDETTemplateName, purgeable) {
- "Applelink Address Info Page Aspect, use other name"
- };
-
- // this template apply to the kMailSlotsAttrTypeBody attribute
- resource 'rstr' (kALNKAddressInfoPage+kDETAttributeType, purgeable) {
- kMailSlotsAttrTypeBody
- };
-
- // this is for build in info page view popup
- resource 'rstr' (kALNKAddressInfoPage+kDETInfoPageName, purgeable) {
- "Applelink Address"
- };
-
- // this is to relate the info page to the right aspect
- // this need to be exactly same string as aspect kDETName
- resource 'rstr' (kALNKAddressInfoPage+kDETInfoPageMainViewAspect, purgeable) {
- "Applelink Address Info Page Aspect"
- };
-
-
- resource 'detv' (kALNKAddressInfoPage, "subpageview", purgeable)
- {
- {
- kDETSubpageIconRect, kDETNoFlags, kDETAspectMainBitmap,
- Bitmap { kDETLargeIcon };
-
- {kNameTop, kMy1stColumnLeft, kNameBottom, kMy1stColumnRight}, kDETNoFlags, kDETNoProperty,
- StaticTextFromView { kDETApplicationFont, kDETApplicationFontSize, kDETRight, kDETBold,"Name:" };
-
- {kNameTop, kMy2ndColumnLeft, kNameBottom, kMy2ndColumnRight}, kDETNoFlags, kDETAspectName,
- EditText { kDETApplicationFont, kDETApplicationFontSize, kDETLeft, kDETNormal };
-
- {kAddressTop, kMy1stColumnLeft, kAddressBottom, kMy1stColumnRight}, kDETNoFlags, kDETNoProperty,
- StaticTextFromView { kDETApplicationFont, kDETApplicationFontSize, kDETRight, kDETBold,"Address:" };
-
- {kAddressTop, kMy2ndColumnLeft, kAddressBottom, kMy2ndColumnRight}, kDETNoFlags, kPrALNKAddress,
- EditText { kDETApplicationFont, kDETApplicationFontSize, kDETLeft, kDETNormal };
- };
- };
-
-
- // Include all of the appropriate icon suite resources
- #define ICONID (kALNKAddressInfoPageAspect+kDETAspectMainBitmap)
- include $$SHELL("BLJBovineServer")"BovineServerIcons.rsrc" 'ICN#' (200) as 'ICN#' (ICONID);
- include $$SHELL("BLJBovineServer")"BovineServerIcons.rsrc" 'icl8' (200) as 'icl8' (ICONID);
- include $$SHELL("BLJBovineServer")"BovineServerIcons.rsrc" 'icl4' (200) as 'icl4' (ICONID);
- include $$SHELL("BLJBovineServer")"BovineServerIcons.rsrc" 'ics8' (200) as 'ics8' (ICONID);
- include $$SHELL("BLJBovineServer")"BovineServerIcons.rsrc" 'ics4' (200) as 'ics4' (ICONID);
- include $$SHELL("BLJBovineServer")"BovineServerIcons.rsrc" 'SICN' (200) as 'SICN' (ICONID);
- include $$SHELL("BLJBovineServer")"BovineServerIcons.rsrc" 'ics#' (200) as 'ics#' (ICONID);
-
-
- data 'FREF' (128) {
- $"6465 7466 0000 7F" /* detf... */
- };
-
- resource 'BNDL' (128) {
- 'ALNK', 0,
- { 'FREF', { 0, 128 },
- 'ICN#', { 0, ICONID }
- }
- };
-